class Solution {
public:
    int rangeBitwiseAnd(int m, int n) {
        int zeros = 0;
        while (m < n) {
            ++zeros;
            m >>= 1;
            n >>= 1;
        }
        return m << zeros;
    }
};